package com.zhuang.chapter12.work04;

import java.util.ArrayList;

public class TestArrayList {
	public static void main(String[] args) {
		ArrayList<String> list = new ArrayList<String>();
		list.add("张三");
		list.add("李四");
		list.add("王五");
		list.add("马六");
		list.add("赵七");
		for (int i = 0; i < list.size(); i++) {
			System.out.println("第" + (i + 1) + "条数据为：" + list.get(i));
		}
		System.out.println("-------------------");
		System.out.println("集合大小为：" + list.size());
		list.remove(2);
		for (int i = 0; i < list.size(); i++) {
			System.out.println("第" + (i + 1) + "条数据为：" + list.get(i));
		}
		System.out.println("第3条数据为：" + list.get(2));
		System.out.println("集合大小为：" + list.size());
	}

}
